package com.goodview.adminservice.controller;




import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.goodview.adminservice.entity.EduTeacher;
import com.goodview.adminservice.service.EduTeacherService;
import com.goodview.commonutils.utils.R;

import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 讲师 前端控制器
 * </p>
 *
 * @author wangyibo
 * @since 2021-10-09
 */
@RestController
@RequestMapping("/adminservice/edu-teacher")
public class EduTeacherController {
    @Autowired
    private EduTeacherService teacherService;

    @GetMapping("/findList")
    public R findList(){
        return R.ok().data("data", teacherService.list(null));
    }

    @GetMapping("/findPage")
    public R findPage(@RequestParam Integer pageNo, @RequestParam Integer pageSize){
        Page<EduTeacher> page = new Page<>(pageNo,pageSize);
        IPage<EduTeacher> teacherPage = teacherService.page(page, null);
        return R.ok().data("data", teacherPage);
    }
}

